package main

import (
	"log"
	orm "website/dao"
	"website/model"
	"website/router"
)

func main() {
	if err := orm.InitDB(); err != nil {
		log.Fatalf("mysql conect init failed, err: %s", err)
		return
	}
	// 创建数据表
	if err := orm.Easy.AutoMigrate(
		&model.Contact{},
		&model.Managers{},
	); err != nil {
		log.Fatalf("AutoMigrate DB failed, err: %s", err)
		return
	}

	router.Run()
}
